package decorator
{
	public class LineReader extends AbstractReaderDecorator
	{
		private var _lines:Array;
		public function LineReader(reader:IReader)
		{
			super(reader);
			
			var expression:RegExp = /[\n\r\f]/g;
			
			_lines = readString().split(expression);
		}
		override public function read():String{
			var line:String = _lines[index++];
			return line;
		}
		override public function readArray(offset:uint=0, length:uint=0):Array{
			return _lines.concat();
		}
		override public function hasNext():Boolean{
			return index < _lines.length;
		}
		
	}
}